package com.beeasy.tools.bean.objects.vos;

import com.beeasy.tools.bean.MapperEntity;
import com.beeasy.tools.bean.MapperField;
import com.beeasy.tools.bean.mapper.ArrayToStringMapper;
import com.beeasy.tools.bean.mapper.RoleNameMapper;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@MapperEntity(ignoreFields = {"password"})
public class UserVo {

    String id;
    String name;
    String password;
    int age;

    @MapperField(mapper = RoleNameMapper.class, params = "key=rids")
    List<String> roleNames = new ArrayList<>();

//    @MapperField(mapper = RoleNameMapper.class, params = "key=${key}")
//    List<String> roleNames2 = new ArrayList<>();

    @MapperField(mapper = RoleNameMapper.class, params = "key=${key:rids}")
    List<String> roleNames3 = new ArrayList<>();

    @MapperField(mapper = ArrayToStringMapper.class)
    String rids;
}
